<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders_call_client', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('订单支付成功通知前端');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('user_id')->comment('用户id')->unsigned()->default(0);
            $table->integer('order_id')->comment('订单流水id')->unsigned()->default(0);
            $table->tinyInteger('is_call')->comment('1已通知')->default(0);
            $table->integer('call_time')->comment('通知时间')->unsigned()->default(0);

            $table->index('create_time');
            $table->index('user_id');
            $table->index('order_id');
            $table->index('is_call');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders_call_client');
    }
};
